/**
 * 
 */
package santeclair.referentiel.gestionnaire.webservice.rest.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import santeclair.referentiel.gestionnaire.bean.SituationAdministrative;
import santeclair.referentiel.gestionnaire.dto.SituationAdministrativeDto;
import santeclair.referentiel.gestionnaire.service.SituationAdministrativeService;
import santeclair.referentiel.gestionnaire.webservice.SituationAdministrativeWebService;

/**
 * @author cquintin
 * 
 */
@Service("situationAdministrativeWebService")
public class SituationAdministrativeWebServiceImpl implements SituationAdministrativeWebService {

    @Autowired
    private SituationAdministrativeService situationAdministrativeService;

    /**
     * {@inheritDoc}
     */
    @Override
    public SituationAdministrativeDto getByCode(String codeSituationAdministrative) {
        SituationAdministrativeDto dto = new SituationAdministrativeDto();
        SituationAdministrative situationAdministrative = situationAdministrativeService.getByCode(codeSituationAdministrative);
        dto.setId(situationAdministrative.getId());
        dto.setCode(situationAdministrative.getCode());
        dto.setLibelle(situationAdministrative.getLibelle());
        return dto;
    }

}
